// 4.定义Person类
// 属性：姓名，年龄
// 行为：keepPet(Dog dog,String something)方法
// 功能：喂养宠物狗，something表示喂养的东西
// 该方法调用后打印结果为：颜色为黑色的2岁的狗，在吃骨头
// 行为：keepPet(Cat cat,String something)方法
// 功能：喂养宠物猫，something表示喂养的东西
// 该方法调用后打印结果为：颜色为白色的2岁的猫，在吃小鱼干
public class Person {
    private String name;
    private int age;
    public void keepPet(Dog dog,String something){
        System.out.print(this.age+"岁的"+this.name+"正在给");
        dog.eat(something);
    }
    public void keepPet(Cat cat,String somthing){
        System.out.print(this.age+"岁的"+this.name+"正在给");
        cat.eat(somthing);
    }

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
